package title;

import java.util.Scanner;

/**
 * 功能：
 * 作者：lc
 * 日期：2024/12/1 1:48
 */
public class MainP5707 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int v = scanner.nextInt();
        int one = 8 * 60-10;
        int two = 32 * 60-10;
        int tal = s / v;
        if (s % v != 0) {
            tal++;
        }
        if (tal<=one){
            int h = (one - tal) / 60;
            int m = (one - tal) % 60;
            if(m<10){
                System.out.println("0"+h+":0"+m);
            }else {
                System.out.println("0"+h+":"+m);
            }
        }else {
            int h=(two-tal)/60;
            int m = (two - tal) % 60;
            if (m<10){
                System.out.println(h+":0"+m);
            }else {
                System.out.println(h+":"+m);
            }

        }

    }
}
